﻿/**
 * Reboulder - Partial Boulder Dash clone
 * Jesús Sagra, 2014
 * 
 * ScoreBar class: shows points' score, items' score, lives score
 * 
 * Version    Date     Changes
 * -----------------------------------------------------
 *  0.01   06-mar-2015  Constructor. Setters/getters. Draw scores.   
 */

class ScoreBar
{
    protected Font font18;
    protected byte lives;
    protected int score;
    protected int pickedItems;
    protected int totalItems;

    public ScoreBar(int items , byte playerLives)
    {
        font18 = new Font("data/Joystix.ttf", 18);
        score = 0;
        pickedItems = 0;
        lives = playerLives;
        totalItems = items;
        
    }

    public void SetLives(byte playerLives)
    {
        lives = playerLives;
    }

    public void SetScore(int points)
    {
        score += points;
    }

    public int GetScore()
    {
        return score;
    }

    public void SetPickedItems()
    {
        pickedItems++; 
    }

    public int GetPickedItems()
    {
        return pickedItems;
    }

    public void Draw()
    {
        //Points' score
        SdlHardware.WriteHiddenText("Score: " + score,
            40, 10,
            0xCC, 0xCC, 0xCC,
            font18);
        //Items' score
        SdlHardware.WriteHiddenText("Items: " + pickedItems + "/" + totalItems,
            400, 10,
            0xCC, 0xCC, 0xCC,
            font18);
        //Lives Score
        SdlHardware.WriteHiddenText("Lives: " + lives,
            890, 10,
            0xCC, 0xCC, 0xCC,
            font18);
    }
}